package cn.janyd.jmall.management.controller.passport.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author Janyd
 * @since 2020-08-15 17:31
 */
@Data
@ApiModel("登录信息")
public class AdminLoginDTO {

    @NotEmpty(message = "{username.must.be.not.empty}")
    @Length(min = 5, max = 16, message = "{incorrect.username.length}")
    @Pattern(regexp = "^[A-Za-z0-9]+$", message = "{incorrect.username.format}")
    @ApiModelProperty(value = "用户名", required = true, example = "admin")
    private String username;

    @NotEmpty(message = "{password.must.be.not.empty}")
    @Length(min = 4, max = 16, message = "{incorrect.password.length}")
    @ApiModelProperty(value = "用户名", required = true, example = "admin")
    private String password;
}
